<%@ page import="java.util.List" %>
<%@ page import="project.pojo.Student" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: d11yu
  Date: 2022/4/9
  Time: 7:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>输出10个学生信息</title>
    <style>
        table {
            border-collapse: collapse;
            width: 400px;
        }

        td {
            border: 1px black solid;
            text-align: right;
        }

        th, td.num {
            border: 1px black solid;
            text-align: center;
        }
    </style>
</head>
<body>
<%
    List<Student> students = (List<Student>) request.getAttribute("stuList");
%>
<table>
    <tr>
        <th>id</th>
        <th>name</th>
        <th>age</th>
        <th>phone</th>
    </tr>
    <%
        for (Student student : students) { %>
    <tr>
        <td class="num">
            <%=student.getId()%>
        </td>
        <td>
            <%=student.getName()%>
        </td>
        <td class="num">
            <%=student.getAge()%>
        </td>
        <td>
            <%=student.getPhone()%>
        </td>
    </tr>
    <% }
    %>
</table>
</body>
</html>
